/**
 * @file ngdefaultmessagecoder.h
 * @author Suk Robert Koh (srkoh87z@gmail.com)
 *
 * @brief NGDefaultMessageCoder class handles encoding/decoding of the message by default
 *
 * TODO: implement input validation
 */

#ifndef NGDEFAULTMESSAGECODER_H_
#define NGDEFAULTMESSAGECODER_H_

#include <stdlib.h>
#include <string.h>
#include "ngmessagecoder.h"
#include "../ngtypes.h"

/**
 * @class	NGDefaultMessageCoder	Handles encoding/decoding of the message
 */
class NGDefaultMessageCoder : public NGMessageCoder
{
public:
	NGDefaultMessageCoder();
	virtual ~NGDefaultMessageCoder();

	char *encode(NGMessage *msg);
	NGMessage *decode(const char *data, DWORD userId);

	WORD getMessageLength(const char *header);
	char *extractData(const char *messageData, int length);
};

#endif /* NGDEFAULTMESSAGECODER_H_ */
